package com.rerun.common.sms;

import java.util.Arrays;

/**
 * 短信模版ID
 * @author Administrator
 *
 */
public class SmsTemplate {
	private String phone;
	private String id;
	private String[] data;
	public SmsTemplate(String phone, String id, String[] data) {
		this.id = id;
		this.phone = phone;
		this.data = data;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String[] getData() {
		return data;
	}
	public void setData(String[] data) {
		this.data = data;
	}
	@Override
	public String toString() {
		return "SmsTemplate [phone=" + phone + ", id=" + id + ", data=" + Arrays.toString(data) + "]";
	}
	
	/**
	 * 发送验证码
	 * @param phone 手机号码
	 * @param code 验证码
	 * @return
	 */
	public static SmsTemplate setConfirmCode(String phone,String code) {
		String [] data = {code,CONFIR_TIME};
		String id = CONFIR_CODE;
		return new SmsTemplate(phone, id, data);
	}
	
	/**
	 * 验证码
	 */
	private static final String CONFIR_CODE = "211800";
	private static final String CONFIR_TIME = "5";
}
